#include "usr_inc.h"

void StartDribbleCmdDeal(void *argument)
{
    for (;;)
    {
        DribbleCmdMsg_t msg;
        xQueueReceive(dribbleCmdQueueHandle, &msg, portMAX_DELAY);

        if (msg == DRIBBLE_EXTEND)
        {
            BSP_FDCAN_SendData(&hfdcan1, 0x301, NULL, FDCAN_DLC_BYTES_0);
        }
        else if (msg == DRIBBLE_RETRACT)
        {
            BSP_FDCAN_SendData(&hfdcan1, 0x302, NULL, FDCAN_DLC_BYTES_0);
        }
        else if (msg == DRIBBLE_DRAW)
        {
            BSP_FDCAN_SendData(&hfdcan1, 0x303, NULL, FDCAN_DLC_BYTES_0);
        }
        else if (msg == DRIBBLE_FREE)
        {
            BSP_FDCAN_SendData(&hfdcan1, 0x304, NULL, FDCAN_DLC_BYTES_0);
        }
        else if (msg == DRIBBLE_PAT)
        {
            BSP_FDCAN_SendData(&hfdcan1, 0x305, NULL, FDCAN_DLC_BYTES_0);
        }
        else if (msg == DRIBBLE_HOLD)
        {
            BSP_FDCAN_SendData(&hfdcan1, 0x306, NULL, FDCAN_DLC_BYTES_0);
        }
        // else if (msg == DRIBBLE_PAT_TWICE)
        // {
        //     BSP_FDCAN_SendData(&hfdcan1, 0x306, NULL, FDCAN_DLC_BYTES_0);
        // }
    }
}
